package com.cqcomponents.api.exceptions;

import com.cqcomponents.api.components.IComponent;

public class MandatoryComponentException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = 9197050290336036313L;

	public MandatoryComponentException(String resourcePath,
			Class<IComponent> componentClass,
			Class<IComponent> requiredComponentClass,
			String requiredResourcePath, Throwable cause) {
		super("Could not render the resource " + resourcePath + " with class "
				+ componentClass + " because its required component(s) "
				+ requiredComponentClass + " is currently missing under: "
				+ requiredResourcePath, cause);
	}

	public MandatoryComponentException(String resourcePath,
			Class<IComponent> componentClass,
			Class<IComponent> requiredComponentClass,
			String requiredResourcePath) {
		this(resourcePath, componentClass, requiredComponentClass,
				requiredResourcePath, null);
	}

	public MandatoryComponentException(String resourcePath,
			Class<IComponent> componentClass, Exception cause) {
		super("Could not render the resource " + resourcePath + " with class "
				+ componentClass, cause);
	}
}
